#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pi;
typedef vector<pi> vii;
int solve() {
  int n;cin>>n;
  vector<pair<int,bool>> v(n*2);
  for(int i=0;i<n;++i) {
    cin>>v[2*i].first;
    v[2*i].second = true;
    cin>>v[2*i+1].first;
    v[2*i+1].second = false;
  }
  sort(v.begin(),v.end());
  int cur = 0;
  int ans = 0;
  for(auto const &el:v) {
    if(el.second==true) cur++;
    else cur--;
    ans = max(ans,cur);
  }
  cout<<ans<<"\n";
  return 0;
}
int main() {
  solve();
  return 0;
}
